package internal

import (
	"context"

	fpyDcsDb "gf/fpy/dcs/db"
)

func init() {
	fpyDcsDb.SetSoPath("./fpy/dcs/db/.so/db.so")
	fpyDcsDb.SetDbUrl("http://192.168.8.101:11001")
	fpyDcsDb.SetDbSid("0ao6")
}

type UserUserDao struct {
	sid 	string
	dbSid   string
	projectSid 	string
	table   string
	group   string
	columns TUserUserColumns
}

type TUserUserColumns struct {
    Sid    string
    AddTime    string
    UpdateTime    string
    IsDel    string
    Avatar    string
    Birthday    string
    Email    string
    LastIp    string
    LastLoginTime    string
    LevelSid    string
    Password    string
    Phone    string
    Qq    string
    RegTime    string
    Sex    string
    State    string
    Username    string
}


var cUserUserColumns = TUserUserColumns{
    Sid:    "sid",
    AddTime:    "add_time",
    UpdateTime:    "update_time",
    IsDel:    "is_del",
    Avatar:    "avatar",
    Birthday:    "birthday",
    Email:    "email",
    LastIp:    "last_ip",
    LastLoginTime:    "last_login_time",
    LevelSid:    "level_sid",
    Password:    "password",
    Phone:    "phone",
    Qq:    "qq",
    RegTime:    "reg_time",
    Sex:    "sex",
    State:    "state",
    Username:    "username",
}

func NewUserUserDao() *UserUserDao {
	return &UserUserDao{
		sid: 	"0app",
		dbSid:	"0ao6",
		projectSid:	"dbd3",
		group:   "user",
		table:   "user",
		columns: cUserUserColumns,
	}
}

func (dao *UserUserDao) Columns() TUserUserColumns {
	return dao.columns
}

func (dao *UserUserDao) Group() string {
	return dao.group
}

func (dao *UserUserDao) Table() string {
	return dao.table
}

func (dao *UserUserDao) Ctx(ctx context.Context) *fpyDcsDb.TDb {
	return fpyDcsDb.Ctx(ctx).Table(dao.sid).FpyProjectSid(dao.projectSid)
}